#include <iostream>
#include <string>
#include <time.h>
#include <functional>
using namespace std;


int erase(string& strTest)
{
    clock_t ttBefore = 0;
    clock_t ttAfter = 0;
    const int testTimes = strTest.length();

    return testTimes;
}

int main(int argc, char* argv[])
{
    clock_t ttBefore = 0;
    clock_t ttAfter = 0;
    string strTest;
    for (int i = 0; i < 1024; i++)
    {
        strTest.append("0123456789");
    }
    
    string strTest1(strTest);
    const int testTimes = 10000000;

    ttBefore = clock();
    for (int i = 0; i < testTimes; i++)
    {
        erase(strTest);
    }
    ttAfter = clock();

    cout << ttAfter - ttBefore << endl;

    auto erase2 = bind(erase, strTest);
    ttBefore = clock();
    for (int i = 0; i < testTimes; i++)
    {
        erase2();
    }
    ttAfter = clock();

    cout << ttAfter - ttBefore << endl;
    return 0;
}
